<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php"); //
	include("function/function.php");
	$kboy_userid = $_SESSION['kboy_userid'];
	$kboy_user = $_SESSION['kboy_user'];
	$newsid = chkstr(trim($_REQUEST['newsid']));
	if(is_numeric($newsid)){
		$sql="select * from kboy_forum_active where id=$newsid and uid=$kboy_userid and active_model = 1";
		$rows=mysql_query($sql);
		$nums=mysql_num_rows($rows);
		if($nums>0){
			$rs=mysql_fetch_array($rows);
				$active_title = $rs['active_title'];          //
				$active_bigclass = $rs['active_bigclass'];
				$active_mingyi = $rs['active_mingyi'];
				$active_fanwei = $rs['active_fanwei'];
				$active_xianzhi = $rs['active_xianzhi'];
				$active_all_money = $rs['active_all_money'];//
				$active_part_money = $rs['active_part_money'];//
				$active_end_user = $rs['active_end_user'];
				$active_text = $rs['active_text'];//
				
				$active_banner = $rs['active_banner'];
				$active_pic = explode(',',$rs['active_pic']) ;		//
				$active_sollimg = explode(',',$rs['active_sollimg']) ;
				
				
				$active_hd_content = $rs['active_hd_content'];
				$active_all_line = $rs['active_all_line'];
				$active_start_prov = $rs['active_start_prov'];
				$active_start_city = $rs['active_start_city'];
				$active_end_prov = $rs['active_end_prov'];
				$active_end_city = $rs['active_end_city'];
				$active_start_time = $rs['active_start_time'];
				$active_end_time = $rs['active_end_time'];
				$active_power = $rs['active_power'];
				$active_post_time = $rs['active_post_time'];
				$active_center = $rs['active_center'];
				$active_center_time = $rs['active_center_time'];
				$active_jingdian = $rs['active_jingdian'];
				$active_traffic = $rs['active_traffic'];
				$active_traffic_info = $rs['active_traffic_info'];
				$active_contact = $rs['active_contact'];
				$active_contact_people = $rs['active_contact_people'];
				$active_contact_phone = $rs['active_contact_phone'];
				$active_people = $rs['active_people'];
				$active_line = stripslashes($rs['active_line']);
				$active_xingcheng = stripslashes($rs['active_xingcheng']);
				$active_zhuangbei = stripslashes($rs['active_zhuangbei']);
				$active_baoming = stripslashes($rs['active_baoming']);
				$active_ditu = stripslashes($rs['active_ditu']);
				$active_koubei = stripslashes($rs['active_koubei']);
				$active_addtime = $rs['active_addtime'];
				$active_id = $rs['id'];
				$active_transport=$rs['active_transport'];
				$active_charge_details=$rs['active_charge_details'];
				$active_cva_money=$rs['active_cva_money'];
				
				$news_content = stripslashes($rs['travel_content']);
				$news_hit = $rs['travel_hit'];
				
		}else{
			echo erro("该信息已被删除或不存在");
		}
	}else{
		echo erro("该信息已被删除或不存在");
	}
?>
<div class="editor-table" id="temp">
                        <ul class="editor_in">
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动性质：</span>
                                    <select class="basic-select" name="active_bigclass" id="active_bigclass">
									<option value="">==请选择板块==</option>
									<?php
										$bigIDs = 134;
										getSoonClass_option($bigIDs,'',$active_bigclass,3); // 下拉option
									?>
                                    </select>
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>领队：</span>
                                    <input type="text" class="editor-input w100" value="<?=$active_end_user;?>" name="active_end_user" id="active_end_user">
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>活动标题：</span>
                                    <input type="text" class="editor-input w790" value="<?=$active_title;?>" name="active_title" id="active_title">
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l">活动特色：</span>
                                    <textarea class="basic-area" name="active_text" id="active_text"><?=$active_text;?></textarea>
                                </dd>
                            </li>
                            <li>
                                <dd>
                                    <span class="e-l"><em></em>顶部BANNER：</span>
                                    <input type="text" class="editor-input w790" style="width:310px;" name="active_banner" id="active_banner" value="<?=$active_banner?>">
                                    <input type="button" name="Submit2" value="上传图片" class="upload-img2" />仅用于大型活动
                                </dd>
                            </li>
                            <input type="hidden" name="caogao" id="caogao" value="<?=$active_id?>" />
                            <li>
                                <dd>
                                    <span class="e-l"><em>*</em>上传图片：</span>
                                    <input type="button" name="Submit" value="上传更多照片" id="upload-images" class="upload-img"/>&nbsp;&nbsp;活动头像的轮播（最多五张）
                                </dd>
                            </li>
                            <div id='photo-one' style="width: 100%;">
                            <?php foreach ($active_pic as $k => $v) { ?>
                       			 <?php if(!empty($v)){ ?>
                            	<li>
                            			
                            		<input type="text" class="editor-input w790" style="width:310px;margin-left:135px;" name="active_pic[]" value="<?=$v ?>" id="active_pic"><a class="shanchu" style="color: red;margin-left: 5px;" href="javascript:;">X</a>
                            		<input type="hidden" name="active_sollimg[]" class="active_sollimg" value="<?=$active_sollimg[$k] ?>" />
                            	</li>
                           		 <?php } ?>
                        	<?php } ?>
                            </div>
                        		
                            
                            
                            <li class="set-line">
                                <dd>
                                    <span class="e-l"><em>*</em>活动内容：</span>
                                    <div class="basic-hide">
                                        <input type="text"/>
                                        <input type="hidden" value="<?=$active_hd_content;?>" name="active_hd_content" id="active_hd_content" />
                                    </div>
                                    <div class="hd-mark">
                                        <ul>
										  <?php
										$bigclass_sql = "select * from kboy_bigclass where pid=144 order by bigclass_order asc, id asc";
										$bigclass_rows = mysql_query($bigclass_sql);
										while($bigclass_rs = mysql_fetch_array($bigclass_rows)){
										?>
                                          <li <?php if(isInclude($active_hd_content,$bigclass_rs['bigclass_cn'])){ echo " class='selected'";} ?>><a href="javascript:;"><?=$bigclass_rs['bigclass_cn']?></a></li>
									   <?php
										}
						               ?>
                                        </ul>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动强度级别：</span>
									<select class="editor-input w100" name="active_power" id="active_power">
									<option value="">=级别=</option>
									<?php
										getSoonClass_option(149,'',$active_power,3); // 下拉option
									?>
									</select>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动全程：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_all_line;?>" name="active_all_line" id="active_all_line"><span>公里</span></dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>出发地：</span>
                                    <div class="departure_select">
                                        <select class="basic-select prov"  name="active_start_prov"></select>
                                        <select class="basic-select city" disabled="disabled" name="active_start_city"></select>
                                    </div>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动开始时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_start_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_start_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>目的地：</span>
                                    <div class="destination_select">
                                        <select class="basic-select prov" name="active_end_prov"></select>
                                        <select class="basic-select city" disabled="disabled" name="active_end_city"></select>
                                    </div>
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>活动结束时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_end_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_end_time" id="active_end_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>活动景点：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_jingdian;?>" name="active_jingdian" id="active_jingdian">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>报名截止时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_post_time;?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" name="active_post_time" id="active_post_time">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>集合时间：</span>
                                    <div class="layinput">
                                        <input type="text" class="editor-input w170" value="<?=$active_center_time;?>" name="active_center_time" id="active_center_time" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})">
                                        <label class="laydate-icon"></label>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500" style="width: 100%;">
                                    <span class="e-l"><em>*</em>集合地点：</span>
                                    <input type="text" class="editor-input w170" name="active_center" id="active_center">
                                    <span class="e-l" style="color: red;width: 300px;"><em>*</em>（如有多个地址，请用“逗号”隔开）</span>
                                </dd>
                            </li>
                            <!-- <li class="set-line">
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>出行方式：</span>
                                    <div class="f-way">
                                        <label>
                                            <input type="radio" class="radio" name="active_traffic" value="包车">
                                            <i>包车</i></label>
                                        <label>
                                            <input type="radio" class="radio" name="active_traffic" value="不包车" checked="checked">
                                            <i>不包车[前端此处需调整]</i></label>
                                    </div>
                                </dd>
                                <dd class="w500">
                                    <span class="e-l">车辆信息：</span>
                                    <input type="text" class="editor-input w170" name="active_traffic_info" id="active_traffic_info">
                                </dd>
                            </li> -->
                            <li class="set-line">
                                <dd>
                                    <span class="e-l"><em>*</em>出行方式：</span>
                                    <div class="f-way">
                                        <span id="id_chartered_0">
                                            <label>
                                                <input type="radio" class="radio"  <?php if($active_traffic=='包车'){ echo "checked";} ?>  name="active_traffic" value="包车" >
                                                <i>包车</i>
                                            </label>
                                        </span>
                                        <span id="id_chartered_1">
                                            <label>
                                                <input type="radio" class="radio" <?php if($active_traffic=='不包车'){ echo "checked";} ?> name="active_traffic" value="不包车">
                                                <i>不包车</i>
                                            </label>
                                        </span>
                                    </div>
                                    <div id="businfo">
                                        <span class="e-l"><em>*</em>车辆信息：</span>
                                        <input type="text" class="editor-input w170" value="<?=$active_traffic_info;?>" name="active_traffic_info" id="active_traffic_info">
                                    </div>
                                    <div id="othervehicle">
                                        <ul>
										<?php
										$bigclass_sql = "select * from kboy_bigclass where pid=153 order by bigclass_order asc, id asc";
										$bigclass_rows = mysql_query($bigclass_sql);
										while($bigclass_rs = mysql_fetch_array($bigclass_rows)){
										?>
										   <li><label><input name="active_transport[]" type="checkbox" <?php if(isInclude($active_transport,$bigclass_rs['bigclass_cn'])){ echo " checked";} ?>  value="<?=$bigclass_rs['bigclass_cn']?>"> <?=$bigclass_rs['bigclass_cn']?></label></li>
									   <?php
										}
						               ?>
                                        </ul>
                                    </div>
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>联系电话：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_contact;?>" name="active_contact" id="active_contact">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>应急联系电话：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_contact_phone;?>" name="active_contact_phone" id="active_contact_phone">
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>所需人数：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_people;?>"  name="active_people" id="active_people">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>会员价：</span>
                                    <input type="text" class="editor-input w170" name="active_cva_money" value="<?=$active_cva_money;?>" id="active_cva_money">
                                </dd>
                            </li>
                            <li>
                                <dd class="w500">
                                    <span class="e-l"><em>*</em>总金额：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_all_money;?>" name="active_all_money" id="active_all_money">
                                </dd>
                                <dd>
                                    <span class="e-l"><em>*</em>预付金额：</span>
                                    <input type="text" class="editor-input w170" value="<?=$active_part_money;?>" name="active_part_money" id="active_part_money">
                                </dd>
                            </li>
                        </ul>
                        <!--编辑框-->
                        <div class="editor-textBox">
                            <div class="editor-tab">
                                <a href="javascript:;" class="on"><i>*</i>线路描述</a>
								 <a href="javascript:;"><i>*</i>费用说明</a>
                                <a href="javascript:;"><i>*</i>行程安排</a>
                                <a href="javascript:;"><i>*</i>装备要求</a>
                                <a href="javascript:;"><i>*</i>报名须知</a>
								<!--<a href="javascript:;"><i>*</i>目的地地图</a>-->
								<a href="javascript:;"><i>*</i>发起人口碑</a>
                            </div>
                            <div class="editor-textBox-bd">
                                <div id="myEditor_line" style="width:810px;height:240px;"><textarea name="active_line" style="width:810px;height:240px;visibility:hidden;"><?=$active_line;?></textarea></div>
								<div id="myEditor_charge" style="width:810px;height:240px;"><textarea name="active_charge_details" style="width:810px;height:240px;visibility:hidden;"><?=$active_charge_details;?></textarea></div>
                                <div id="myEditor_trip" style="width:810px;height:240px;"><textarea name="active_xingcheng" style="width:810px;height:240px;visibility:hidden;"><?=$active_xingcheng;?></textarea></div>
                                <div id="myEditor_equip" style="width:810px;height:240px;"><textarea name="active_zhuangbei" style="width:810px;height:240px;visibility:hidden;"><?=$active_zhuangbei;?></textarea></div>
                                <div id="myEditor_sign" style="width:810px;height:240px;"><textarea name="active_baoming" style="width:810px;height:240px;visibility:hidden;"><?=$active_baoming;?></textarea></div>
								<!--<div id="myEditor_ditu" style="width:810px;height:240px;"><textarea name="active_ditu" style="width:810px;height:240px;visibility:hidden;"><?=$active_ditu;?></textarea></div>-->
                                <div id="myEditor_koubei" style="width:810px;height:240px;"><textarea name="active_koubei" style="width:810px;height:240px;visibility:hidden;"><?=$active_koubei;?></textarea></div>
                            </div>
                        </div>
                        <!--操作-->
                        <div class="editor-op-bd">
							 <a href="javascript:void(0)" class="save-draft">保存草稿</a>
							<input type="hidden" name="savemodel" id="savemodel" />
							<input type="submit" class="post-hd" value="发布活动" />
                        </div>
                  </div>
<script type="text/javascript">
	$(".shanchu").on("click",function(){
		var div = $(this).parent("li");
								var URL = $(this).siblings('.editor-input').val();
									URL += ',';
									URL += $(this).siblings('.active_sollimg').val();
								$.ajax({
									type:"post",
									url:"ajax.php?tu=pian",
									data:{URL:URL},
									dataType:"json",
									success:function(data){
										if(data == 33){
											div.remove();
											alert("文件已经被删除")
										}
										if(data == 22){
											alert("文件删除失败")
										}else{
											div.remove();
										}
									}
								});
	})
</script>